package com.zxm.web.controller.txcloud.qq;

import com.zxm.common.core.domain.AjaxResult;
import com.zxm.common.core.domain.entity.QQPo;
import com.zxm.common.utils.QQUtil;
import com.zxm.common.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Author silence.Z
 * @Date 2022/8/3 14:35
 * @PackageName:com.zxm.web.controller.txcloud.qq
 * @ClassName: QQController
 * @Description: QQ控制器
 * @Version 1.0
 */
@RestController
@RequestMapping("txcloud/qq/qq")
public class QQController {
	private static final Logger log = LoggerFactory.getLogger(QQController.class);

	@PreAuthorize("@ss.hasPermi('txcloud:face:qq:list')")
	@GetMapping("getQQInfo")
	/**
	 * 输入QQ号获取QQ信息
	 */
	public AjaxResult getQQInfo(@Validated Long qqId) {
		QQPo qqInfo = QQUtil.getQQInfo(qqId);
		if (StringUtils.isEmpty(qqInfo.getName())){
			return AjaxResult.error("查询失败！");
		}
		return AjaxResult.success(qqInfo);
	}
}
